﻿<Window x:Class="WpfSimpleCharttest.WpfSimpleChartDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:chart="clr-namespace:De.LarsHildebrandt.WpfControls.WpfSimpleChart;assembly=De.LarsHildebrandt.WpfControls.WpfSimpleChart"
    xmlns:local="clr-namespace:WpfSimpleCharttest"
    Title="WpfSimpleChart" Height="400" Width="600"
    x:Name="frmMain"
        >
    <Window.Resources>
        <RadialGradientBrush x:Key="ChartBackground">
            <RadialGradientBrush.RelativeTransform>
                <TransformGroup>
                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.15" ScaleY="1.15"/>
                    <TranslateTransform X="-0.08" Y="-0.08"/>
                </TransformGroup>
            </RadialGradientBrush.RelativeTransform>
            <GradientStop Color="#FFEEE8C8" Offset="1"/>
            <GradientStop Color="#FFDDD5AC" Offset="0"/>
        </RadialGradientBrush>
        <LinearGradientBrush x:Key="IsMouseOver" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="#FFDC9314"/>
            <GradientStop Offset="0.564" Color="#FFD6CA79"/>
            <GradientStop Color="#FFE6A03A" Offset="0.982"/>
        </LinearGradientBrush>
    </Window.Resources>    
    <TabControl SelectedIndex="0">
        <TabItem Header="Barchart">
                <chart:BarChart
                    Caption="WpfSimpleChart - BarChart"
                    Grid.Row="0" 
                    x:Name="chartTest" 
                    ChartLegend="{Binding Path=BarLegend, ElementName=frmMain}"
                    DataContext="{Binding Path=BarRows, ElementName=frmMain}"
                    ChartBackground="{StaticResource ChartBackground}"
                    ChartScrollBarVisibility="Disabled"
                    ChartMargin="5"
                    ChartCaptionVisibility="Collapsed"
                    ChartColorMouseOver="{StaticResource IsMouseOver}"
                    Margin="20"
                >
                </chart:BarChart>
        </TabItem>
        <TabItem Header="Piechart">
            <Grid>
                <chart:PieChart 
                    x:Name="pieChart"
                    Caption="WpfSimpleChart - PieChart"
                    ChartBackground="{StaticResource ChartBackground}"
                    ChartLegend="{Binding Path=PieLegend, ElementName=frmMain}"
                    DataContext="{Binding Path=PieRows, ElementName=frmMain}"
                    ChartColorMouseOver="{StaticResource IsMouseOver}"
                    Margin="20">
                </chart:PieChart>
            </Grid>
        </TabItem>
        <TabItem Header="Stackedchart">
            <Grid>
                <chart:StackedChart 
                    x:Name="stackedChart"
                    Caption="WpfSimpleChart - StackedChart"
                    ChartBackground="{StaticResource ChartBackground}"
                    ChartItemWidth="5"
                    ChartShowCaption="Visible"
                    ChartMargin="5"
                    ChartCornerRadius="1"
                    ChartColorMouseOver="{StaticResource IsMouseOver}"
                    ChartLegend="{Binding Path=StackedLegend, ElementName=frmMain}"
                    DataContext="{Binding Path=StackedRows, ElementName=frmMain}"
                    Margin="20">
                </chart:StackedChart>
            </Grid>
        </TabItem>        
    </TabControl>

</Window>
